<?php
class ome_finder_return_process{
    var $detail_basic = "收货/质检详情";
    
    function detail_basic($por_id){
        $render = app::get('ome')->render();
        $oProduct_pro = &app::get('ome')->model('return_process');
        $oOrder = &app::get('ome')->model('orders');
        $oProduct_pro_detail = $oProduct_pro->product_detail($por_id);
        $render->pagedata['pro_detail'] = $oProduct_pro_detail;
        if (!is_numeric($oProduct_pro_detail['attachment'])){
           $render->pagedata['attachment_type'] = 'remote';
        }
        $render->pagedata['order'] = $oOrder->dump($oProduct_pro_detail['order_id']);
        return $render->fetch('admin/sv_charge/detail.html');
    }

    var $addon_cols='por_id,recieved,verify';
    var $column_process_edit='操作';
    var $column_process_edit_width='100';

    function column_process_edit($row){
        $finder_id = $_GET['_finder']['finder_id'];
        if($_GET['ctl']=='admin_sv_charge'){
            if($row[$this->col_prefix.'recieved']=='false'){
               return '<a href="index.php?app=ome&ctl=admin_sv_charge&act=edit&p[0]='.$row[$this->col_prefix.'por_id'].'&finder_id='.$finder_id.'" target="_blank">收货</a>';
            }
       }
       if($_GET['ctl']=='admin_sv_process'){
           if($row[$this->col_prefix.'verify']=='false'){
               return '<a href="index.php?app=ome&ctl=admin_sv_process&act=edit&p[0]='.$row[$this->col_prefix.'por_id'].'&finder_id='.$finder_id.'" target="_blank">质检</a>';
           }
       }

   }

}
?>